--
-- Author: shunguo.chen
-- Date: 2017-06-21 14:55:09
--
-- ReloadingView
-- 游戏切回前台是重新加载资源

local TextureCache = cc.Director:getInstance():getTextureCache()

local fileName = string.getModeName(...)
local ClassRef = class(fileName, function()
	return cc.LayerColor:create(cc.c4b(0,0,0,255),display.width,display.height)
end)

function ClassRef:ctor(path)
	path = path or "loading/8300.png"
	TextureCache:reloadTexture(path)
	local bg = ccui.ImageView:create()
	bg:loadTexture(path)
	bg:setPosition(display.width/2, display.height/2)
	self:addChild(bg)

	local text = ccui.Text:create()
	text:setString(desc)
	text:setFontSize(30)
	text:setPosition(display.width/2, 40)
	text:setAnchorPoint(0.5,0.5)
	self:addChild(text)
	self._text = text
end

function ClassRef:setProgress(pg)
	self._text:setString(L("lua_code_text_52").. pg*100 .. "%")
end

return ClassRef